#ifndef __ADBINTERFACE_H_
#define __ADBINTERFACE_H_

#include <string>
#include <vector>
#include "Vendor.h"

class AdbInterface
{
public:
	AdbInterface();
	~AdbInterface();

	static bool start_adb_server();

	static BOOL run_adb_cmd(const char* cmd, std::string &rst, int timeout_sec=1800);
	static BOOL run_adb_cmd(const char* sn, const char* cmd, std::string &rst, int timeout_sec);

	static int get_device_list(std::vector<std::string> &device_list);

	static void get_mac_and_imei(const char* sn, std::string &mac, std::string &imei);
	static void get_ssn_vid_pid(const char* sn, std::string &ssn, std::string &vid, std::string &pid);
	static std::string get_product_model(const char* sn);
	static std::string get_product_brand(const char* sn);
	static std::string get_version(const char* sn);
	static int get_build_api(const char* sn);
	static bool is_vendor_equals(const char* sn, const VendorID vid);

	static BOOL push_file(const char* sn, const char* sourcePath, char* destPath);
	static BOOL install_apk(const char* sn, const char* apk);

private:
	//static void _init_wsa();
	//static void _send_recv_data(SOCKET &ConnectSocket, char* sndBuf, char* rcvBuf, int ilen, bool bBlock = true);

	static void remove_control_character(std::string &str);
	static std::string get_imei(const char* sn);
	static std::string get_mac_address(const char* sn);

};

#endif // __ADBINTERFACE_H_

